#ifndef GAME_UTIL_H
#define GAME_UTIL_H
#include <string>
std::string GetShortTimeString();
std::string GetDateString();
std::string GetTimeString();
std::string GetTimeStringWithoutSpace();
std::string GetExecPath();
std::string CancatPath(const std::string& path1, const std::string& fileName);
std::string GetExecPathFileName(const std::string& fileName);
std::string GetLuaFileValue(const std::string& fileName);
std::string GetFileString(const std::string& fileName);
bool SaveStringToFile(const std::string& fileName, const std::string& data);

bool getResultOfPercent(double percent);

#define RECIEVE_FORMAT_DATA(format, retString) \
{ \
char* va_dataResult = NULL; \
int va_bufferLen = 4096; \
int va_actualLen = 0; \
va_list list; \
va_start(list, format); \
do {\
	if(va_dataResult) {\
		free(va_dataResult);	\
	}\
	va_bufferLen *= 2;\
	va_dataResult = (char*)calloc(1, va_bufferLen);\
	va_actualLen = vsnprintf(va_dataResult, va_bufferLen, format, list);\
} while(va_actualLen == va_bufferLen);	\
va_end(list); \
retString = va_dataResult; \
free(va_dataResult); \
}

int doubleToInt(double input);
#endif